#!/usr/bin/php
<?php

require(dirname(__FILE__)."/../src_v2/classes/Token.php");


$uname   = 'piotr';
$pwd_md5 = md5('pass');

$token = Token::generate($uname, $pwd_md5, 1800);

$cookie_struct = array( 'token' => $token);
$cookie_json   = json_encode( $cookie_struct );


$_COOKIE['ParaSite_Auth'] = $cookie_json;


require_once(dirname(__FILE__)."/../src_v2/classes/init.php");

$dbl = $PARAPARA->dblayer;
$status = $dbl->forum_unarchive_threads( 1 );
echo "Archived thread  \n";


echo $dbl->latest_query, "\n";
echo $dbl->mysql_error, "\n";

?>